package com.bobi.tfca.network.api

import com.bobi.tfca.network.response.ActivityResponse
import com.bobi.tfca.network.response.BaseResponse
import com.bobi.tfca.network.response.MemberResponse
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Headers
import retrofit2.http.POST
import retrofit2.http.Path
import kotlin.collections.ArrayList

interface ActivityAPI {

    /**
     * 组织活动
     */
    @Headers("Content-Type: application/json;charset=utf-8", "Accept: application/json")
    @POST("/activity/organizeActivity")
    fun organizeActivity(@Body activity: ActivityResponse) : Call<BaseResponse<Int>>

    /**
     * 移除活动成员
     */
    @Headers("Content-Type: application/json;charset=utf-8", "Accept: application/json")
    @POST("/activity/removeMember/{activityId}")
    fun removeMember(@Path("activityId") activityId: Int, @Body memberIds: ArrayList<Int>): Call<BaseResponse<String>>

    /**
     * 查询所有活动成员
     */
    @Headers("Accept: application/json")
    @GET("/activity/findAllMembers/{activityId}")
    fun findAllMembers(@Path("activityId") activityId: Int) : Call<BaseResponse<List<MemberResponse>>>

    /**
     * 查询所有活动
     */
    @Headers("Accept: application/json")
    @GET("/activity/findAll")
    fun findAll() : Call<BaseResponse<ArrayList<ActivityResponse>>>

    /**
     * 查询活动细节内容
     */
    @Headers("Accept: application/json")
    @GET("/activity/getActivityDetails/{activityId}")
    fun getActivityDetails(@Path("activityId") activityId: Int): Call<BaseResponse<ActivityResponse>>

    /**
     * 取消报名
     */
    @Headers("Accept: application/json")
    @POST("/activity/cancelSign/{activityId}")
    fun cancelSign(@Path("activityId") activityId: Int): Call<BaseResponse<String>>

    /**
     * 报名
     */
    @Headers("Accept: application/json")
    @POST("/activity/signUp/{activityId}")
    fun signUp(@Path("activityId") activityId: Int): Call<BaseResponse<String>>

    /**
     * 结束活动
     */
    @Headers("Accept: application/json")
    @POST("/activity/finishActivity/{activityId}")
    fun finishActivity(@Path("activityId") activityId: Int): Call<BaseResponse<String>>

    /**
     * 取消活动
     */
    @Headers("Accept: application/json")
    @POST("/activity/cancelActivity/{activityId}")
    fun cancelActivity(@Path("activityId") activityId: Int): Call<BaseResponse<String>>

    /**
     * 查询我的活动
     */
    @Headers("Accept: application/json")
    @GET("/activity/findMyActivities")
    fun findMyActivities(): Call<BaseResponse<ArrayList<ActivityResponse>>>
}